package com.car.sale.controller;

import com.car.sale.service.FuelService;
import com.car.sale.vo.Count;
import com.car.sale.vo.Month;
import com.car.sale.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/fuel")
@ResponseBody
public class FuelController {
    @Autowired
    private FuelService fuelService;
    @GetMapping("/count")
    public Result<Object> getCarCount()
    {
        List<Count> countList = fuelService.getFuelCount();
        return Result.success(countList);
    }
    @GetMapping("/month")
    public Result<Object> getCarMonth()
    {
        List<Month> monthList = fuelService.getFuelMonth();
        return Result.success(monthList);
    }

}
